package com.itHsuSE.demo10;

import com.itHsuSE.demo11.GrandFather;

/**
 * @author Hsu琛君珩
 * @ClassName:Test1
 * @date 2023-12-20
 * @apiNote
 * @Version: v1.0
 */

public class Test1 {
    public static void main(String[] args) {
        Son son=new Son();
        System.out.println(son.c);
        System.out.println(son.b);
        System.out.println(son.d);

        GrandSon grandSon=new GrandSon();
        System.out.println(grandSon.getB());
        System.out.println(grandSon.getD());
    }
}

class Father {
    private int a;
    protected int b;
    public int c;
    int d;

    public int getA() {
        return a;
    }
}

class Son extends Father{
    int x;
    protected int y;
    private int z;

    public int getZ() {
        return z;
    }
    public int getB(){
        return b;
    }
}

class GrandSon extends GrandFather{
    int p;

    public int getB(){
        return b;
    }
}
